<#include "/common/common.ftl">
<form class="pageForm">
	<input type="hidden" name="id" value="${id!}"/>

	<div>
		<TABLE class=queryTable cellSpacing=0 width="100%" align=center
		       border=0>
			<tr>
				<th width="9%">
				</th>
				<th width="18%">
			</tr>
			<tr>
				<td class="right">
				<@s.text name="userCode"/><@splitor/>
				</td>
				<td>
					<input name="userCode" type="text" id="userCOde"
					       value="${userCode!}" size="15" disabled="true"/>
				</Td>
			</tr>
			<tr>
				<td class="right">
				<@s.text name="userName"/><@splitor/>
				</td>
				<td>
					<input name="userName" type="text" id="userName"
					       value="${userName!}" size="15" disabled="true"/>
				</td>
			</tr>
			<tr>
				<td class="right">
				<@s.text name="oldPassword"/><@splitor/>
				</td>
				<td>
					<input type="text" name="oldPassword" size="15"
					       class="required alphanumeric"/>
				</td>
			</tr>
			<tr>
				<td class="right">
				<@s.text name="newPassword"/><@splitor/>
				</td>
				<td>
					<input type="text" id="password" name="password" size="15"
					       class="required alphanumeric"/>
				</td>
			</tr>
			<tr>
				<td class="right">
				<@s.text name="newPassword"/><@splitor/>
				</td>
				<td>
					<input type="text" size="15" id="password2"
					       class="required alphanumeric"/>
				</td>
			</tr>
		</TABLE>
	<@listButton/>
</form>
<script type="text/javascript">
	$("#btnSave", $.pdialog.getCurrent()).click(
			function() {
				var $form = $(".pageForm", $.pdialog.getCurrent());
				if (!$form.valid()) {
					return false;
				}
				var pass1 = $("#password", $.pdialog.getCurrent()).val();
				var pass2 = $("#password2", $.pdialog.getCurrent()).val();
				if (pass1 != pass2) {
					alert("密码不一致！");
					return false;
				}
				$.post("${path}/system/user.save.do", $form.serializeArray(),
						function(json) {
							showMessage(json);
						}, 'json')
			})
</script>